package com.decent.web.system.controller;

import com.decent.common.bo.MessageBean;
import com.decent.web.system.service.SystemBannerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: decent Gjh
 * @date: 2022/10/25/14:42
 * @description:
 */
@RequestMapping("banner")
@RestController
@Slf4j
@CrossOrigin
public class BannerController {
    private final SystemBannerService bannerService;

    public BannerController(SystemBannerService bannerService) {
        this.bannerService = bannerService;
    }

    /**
     * 获取所有banner
     * @return 包含banner列表的messageBean
     */
    @GetMapping()
    public MessageBean getBanner(){
        return bannerService.getBanner();
    }
}
